﻿using System;

using System.Collections.Generic;
using System.Text;

namespace Silvermoon.Controls
{
    /// <summary>
    /// Specifies what part(s) of a control are invalidated.
    /// </summary>
    /// <remarks>
    /// As a control developer, you can use this information to determine what to recalculate in the InitializeControl method to avoid
    /// unnecassary calculation.
    /// </remarks>
    [Flags]
    public enum InvalidationFlag : uint
    {
        None = 0,

        /// <summary>
        /// Specifies no change.
        /// </summary>
        Empty = 0,

        /// <summary>
        /// Specifies that size has changed.
        /// </summary>
        Size = 1,

        NoStyleApplied = 2,

        /// <summary>
        /// Specifies a custom change, which is freely to use.
        /// </summary>
        Custom = 4,

        /// <summary>
        /// Specifies that color has changed.
        /// </summary>
        Color = 8,

        /// <summary>
        /// Specifies that the alpha value has changed.
        /// </summary>
        Alpha = 16,

        /// <summary>
        /// Specifies that the Enabled property has changed.
        /// </summary>
        Enabled = 32,

        /// <summary>
        /// Specifies that a controls visibility has changed.
        /// </summary>
        Visible = 64,

        /// <summary>
        /// Specifies that margin has changed.
        /// </summary>
        Margin = 128,

        /// <summary>
        /// Specifies that padding has changed-
        /// </summary>
        Padding = 256,

        /// <summary>
        /// Specifies that the text color has changed.
        /// </summary>
        TextColor = 512,

        /// <summary>
        /// The appearance has changed. If this flag ist set it means that the appearance of some inner controls or shapes have changed, if it can not be specified with
        /// other available flags like InvalidationFlag.Color.
        /// </summary>
        Appearance = 1024,

        /// <summary>
        /// The layout has changed. If this flag is set, it means that the order of some inner control have changed.
        /// </summary>
        Layout = 2048,

        /// <summary>
        /// Specifies that the text has changed.
        /// </summary>
        Text = 4096,

        /// <summary>
        /// Specifies that the texture has changed.
        /// </summary>
        Texture = 8192,

        /// <summary>
        /// Specifies that the control has not yet been initialized once.
        /// </summary>
        Uninitialized = 0x4000,

        /// <summary>
        /// Specifies that transformation has changed.
        /// </summary>
        Transformation = 0x8000,

        Width = 0x10000,
        Height = 0x20000,

        Internal = 0x40000,

        UpdateChildren = 0x80000,
        Internal2 = 0x100000,

        /// <summary>
        /// Specifies that either layout or appearance or both have changed.
        /// </summary>
        LayoutAppearance = Appearance | Layout,

        All = 0xFFFFFFF & ~(InvalidationFlag.Internal | InvalidationFlag.Internal2 | InvalidationFlag.UpdateChildren)
    }
}
